package com.hzit.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hzit.common.util.User;
import com.hzit.user.mapper.UserMapper;
import com.hzit.user.service.IUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

	//1. 根据用户名查询用户
	@Override
	public User findUserByUsername(String username) {
		return this.getOne(new QueryWrapper<User>().eq("username",username));
	}
	//2. 根据用户名查询用户的权限串列表
	@Override
	public List<String> findPermissionsByUsername(String username) {
		return this.baseMapper.findPermissionsByUsername(username);
	}
}
